# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer: dorphell <dorphell@archlinux.org>

pkgname=xlockmore
pkgver=5.74
pkgrel=1
pkgdesc="screen saver / locker for the X Window System"
arch=(loong64 x86_64)
license=('BSD')
depends=(freetype2 gtk2 libxpm openmotif pam libxmu glu)
optdepends=('fortune-mod')
makedepends=(mesa)
url="http://sillycycle.com/xlockmore.html"
options=('!makeflags')
install=xlockmore.install
validpgpkeys=('1B79C8478F236DCDADC0D6ACCF159707377919AE')
DLAGENTS=('https::/usr/bin/curl --user-agent Firefox -fLC - --retry 3 --retry-delay 3 -o %o %u')
source=(https://sillycycle.com/xlock/xlockmore-$pkgver.tar.xz{,.asc}
	LICENSE)
sha512sums=('041d49c835281cdd0c8c92712a38595504658934729bef9604a607a3cd1ac0b243373978c0eb9ac550b73ec9da8ee1425131e835e9a4b6643881b5e163645d30'
            'SKIP'
            '41d878ca0262adbdccf8c3bcd386fc72afbcdcf0bf93a38da23730821ce0727d49223573648ff1e3b083d3b63272f39e4bc5e69eaa6e86609610795aa1c6d739')

build() {
  cd "$srcdir"/$pkgname-$pkgver
  ./configure --prefix=/usr --disable-setuid \
	      --enable-appdefaultdir=/usr/share/X11/app-defaults \
	      --enable-pam --with-gtk2 --without-esound --without-ftgl
  make
}

package() {
  cd "$srcdir"/$pkgname-$pkgver

  make xapploaddir="$pkgdir"/usr/share/X11/app-defaults \
       mandir="$pkgdir"/usr/man/man1 \
       prefix="$pkgdir"/usr install
  install -Dm0644 etc/xlock.pamd "${pkgdir}"/etc/pam.d/xlock
  install -Dm0644 ../LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
  mv "$pkgdir"/usr/man "$pkgdir"/usr/share/
}
